layui.define([
    'jquery'
], function(exports) {
    'use strict';
    var $ = layui.jquery;
    function removeTheme(n) {  
        if (!n) {
            n = window
        }
        if (n.layui) {
            var o = "layuicss-theme";
            n.layui.jquery('link[id^="' + o + '"]').remove()
        }
    }
    function changeThem(n) {  
        top.layui.link(layui.cache.base + "/theme/" + n + ".css",n);
        localStorage.setItem('newBg', n);
        var u = top.window.frames;
        for(var p = 0;p<u.length;p++) {
            var r = u[p];
            removeTheme(r)
            if(n && r.layui) {
                r.layui.link(layui.cache.base + "/theme/" + n + ".css",n);
            }
            var q = r.frames;
            for(var o = 0;o<q.length;o++) {
                var n = q[o];
                removeTheme(n);
                if(n && n.layui) {
                    n.layui.link(layui.cache.base + "/theme/" + n + ".css",n);
                }
            }
        }
    }
    exports("themMenu",{
        removeTheme,
        changeThem
    })
});